<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>map</title>
  <link rel="stylesheet" href="./assets/less/index.css">
</head>
<body>
  <div class="container">
    <canvas width="723" height="350" id="ctx"></canvas>
  </div>
</body>
</html>
<script>
  window.onload = function () {
    var img2 = new Image();
    img2.src = './assets/img/circle2.png'
    var img1 = new Image()
    img1.src = './assets/img/circle1.png'
    var imgMap = new Image()
    imgMap.src = './assets/img/map.png'
    var w = 5
    var h = 5
    // imgMap.onload = function () {
    //   ctx.drawImage(imgMap, 0, 0, 723, 350)
    // }
    var canvas = document.getElementById("ctx")
    var ctx = canvas.getContext('2d')
    img1.onload = function () {
      ctx.drawImage(img1, 15, 15, w, h)
      ctx.drawImage(img2, 150, 150, w, h)
    }
  }
</script>